//
//  BaseViewController.m
//  Tospur-text
//
//  Created by Tospur_hewei on 15/9/24.
//  Copyright (c) 2015年 Tospur_hewei. All rights reserved.
//

#import "BaseViewController.h"
#import "MainViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "MineViewController.h"
#import "BaseNavViewController.h"
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    MainViewController *mainVC = [[MainViewController alloc]init];
    [self addChildViewController:mainVC title:@"楼盘" barImageName:@"cm2_btm_icn_account_prs@2x"];
    
    SecondViewController *secVC = [[SecondViewController alloc]init];
    [self addChildViewController:secVC title:@"风景" barImageName:@"cm2_btm_icn_music_prs@2x"];
    
    ThirdViewController *thirdVC = [[ThirdViewController alloc]init];
    [self addChildViewController:thirdVC title:@"豪车" barImageName:@"cm2_note_icn_listen@2x"];
    
    MineViewController *mineVC = [[MineViewController alloc]init];
    [self addChildViewController:mineVC title:@"个人中心" barImageName:@"cm2_note_icn_logo@2x"];
}

- (void)addChildViewController:(UIViewController *)controller title:(NSString *)title  barImageName:(NSString *)barImageName
{
    BaseNavViewController *baseNavigation = [[BaseNavViewController alloc]initWithRootViewController:controller];
    controller.title = title;
    controller.tabBarItem.image = [UIImage imageNamed:barImageName];
    [self addChildViewController:baseNavigation];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
